package org.joinme.backend.mapper;

import org.apache.ibatis.annotations.Param;
import org.joinme.backend.model.CarPoolingRecord;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
@Transactional
public interface CarPoolingRecordMapper {

    CarPoolingRecord selectByPrimaryKey(Integer carPoolingId);

    int deleteByPrimaryKey(Integer carPoolingId);

    int insert(CarPoolingRecord record);

    int insertSelective(CarPoolingRecord record);

//    List<CarPoolingRecord> selectByUserId(@Param("userId") int userId, @Param("start") int start, @Param("limit") int limit);

//    int countByUserId(int wechatUserId);

    List<CarPoolingRecord> selectAvailableRecords(@Param("userId") int userId, @Param("start") int start, @Param("limit") int limit);

    int countAvailableRecords(int userId);

    List<CarPoolingRecord> selectIngRecords(@Param("userId") int userId, @Param("start") int start, @Param("limit") int limit);

    int countIngRecords(int userId);

    List<CarPoolingRecord> selectEdRecords(@Param("userId") int userId, @Param("start") int start, @Param("limit") int limit);

    int countEdRecords(int userId);

    int updateByPrimaryKeySelective(CarPoolingRecord record);

    int updateByPrimaryKey(CarPoolingRecord record);

    int updateStatus(@Param("carPoolingId") int carPoolingId, @Param("carPoolingStatus") int carPoolingStatus);

    String selectMessage(@Param("carPoolingId") int carPoolingId);

    int updateMessage(@Param("carPoolingId") int carPoolingId, @Param("message") String message);
}
